cc.Class({
    extends: cc.Component,

    properties: {
	
		showTimes: 1, //隐藏时间
		jumpHeight: 100, //跳跃高度
		_isShow: false,
    },

	
	//按钮点击回调
	onConfirBtn: function(callback) {
	
		//console.log("发布按钮点击回调事件");
		this.node.getChildByName("startBtn").on('click', function(event) {
			isShow=0;
			//console.log("点击到按钮");
			 if(typeof callback === "function"){
				 callback();
			 }else{
				 cc.log(callback);
			 }
			
		
			
			this.finish(); //先销毁自己
		}, this);
		
		 
		
	},
    // LIFE-CYCLE CALLBACKS:

    onLoad () {
	 
		cc.log("showTips.onLoad")
		window.showtips = this;
				
		// 初始化计时器
		this.timer = 0;
		this.node.active = true;
		
        let slider = this.getComponent(cc.Slider);
        let progressbar = this.getComponent(cc.ProgressBar);

        if(slider == null || progressbar == null){
            return;
        }

        progressbar.progress = slider.progress;

        let self = this;
        slider.node.on('slide', function(event){
            progressbar.progress = slider.progress;
        }, this);
		
		
	 

    },
	setJumpAction: function() {
		this.timer = 0;
		// 跳跃
		var jumpDown = cc.moveBy(this.showTimes, cc.v2(0, this.jumpHeight)).easing(cc.easeCubicActionIn());
		var callback = cc.callFunc(this.finish, this);
		return cc.repeat(cc.sequence(jumpDown, callback), 1);
	},
	finish: function() {
		
		isShow=0;
		this._isShow = false;
		if (this.node) {
			this.node.active = this._isShow;
		}
		this.node.stopAllActions();
		this.node.destroy();
	},
    start () {

    },

    // update (dt) {},
});
